import { actionTypes } from "./index";
import {fromJS} from 'immutable'
import axios from "axios"

export const getChangeFocusStatusAction = (value) => {
    return {
        type: actionTypes.CHANGE_FOCUS_STATUS,
        value
    }
}
export const getChangeHotListAction = (value) =>{
    return {
        type: actionTypes.CHANGE_HOT_LIST,
        value: fromJS(value)
        // value
    }
}
export const getHotList = ()=>{
    return (dispatch) => {
        axios.get('/api/hostList.json').then((res)=>{
            const data = res.data;
            if (data.success){
                dispatch(getChangeHotListAction(data.data))
            }
        }).catch(()=>{

        })
    }
}
export const getMouseEnterAction = () =>{
    return {
        type: actionTypes.MOUSE_ENTER
    }
}
export const getMouseLeaveAction = () => {
    return {
        type: actionTypes.MOUSE_LEAVE
    }

}
export const getChangePageAction = (page)=>{
    return{
        type: actionTypes.CHANGE_PAGE,
        page: page
    }
}